import { NgModule,SkipSelf,Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule } from '../core/core.module';
import { RouterModule }   from '@angular/router';
import { FormsModule }   from '@angular/forms';
import {DropdownModule,} from 'primeng/primeng';
import { ToastModule } from 'primeng/toast';
import {MatButtonModule,MatInputModule} from '@angular/material';
import { SynonymComponent } from './synonym.component';
import { SynonymManagementComponent } from './synonym-management/synonym-management.component';
import { SynonymManagementTableComponent } from './synonym-management/synonym-management-table/synonym-management-table.component';
import { SynonymManagementAddComponent } from './synonym-management/synonym-management-add/synonym-management-add.component';
import { SynonymManagementUpdateComponent } from './synonym-management/synonym-management-update/synonym-management-update.component';
import { SynonymManagementLeftComponent } from './synonym-management/synonym-management-left/synonym-management-left.component';
import { SynonymManagementDeleteComponent } from './synonym-management/synonym-management-delete/synonym-management-delete.component';
import { DragulaModule } from 'ng2-dragula';
import { PublicModule } from '../public/public.module';
import { BsDatepickerModule } from 'ngx-bootstrap';
import { Ng2SmartTableModule } from 'ng2-smart-table';
import { SynonymManagementDetailsComponent } from './synonym-management/synonym-management-details/synonym-management-details.component';
import { SmartTableService } from './smart-table.service';
import { SidebarModule } from '../sidebar/sidebar.module';

@NgModule({
  imports: [
    CommonModule,
    CoreModule,
    RouterModule,
    FormsModule,
    DragulaModule,
    DropdownModule,
    MatButtonModule,
    MatInputModule,
    PublicModule,
    ToastModule,
    Ng2SmartTableModule,
    BsDatepickerModule.forRoot(),
    SidebarModule
  ],
  declarations: [
    SynonymComponent, 
    SynonymManagementComponent, 
    SynonymManagementTableComponent, 
    SynonymManagementAddComponent, 
    SynonymManagementUpdateComponent, 
    SynonymManagementLeftComponent, 
    SynonymManagementDeleteComponent, SynonymManagementDetailsComponent
  ],
  providers: [
    SmartTableService
  ]
})
export class SynonymModule { 
  constructor(@Optional() @SkipSelf() parent:SynonymModule){
    if(parent){
      throw new Error('Synonym模块已经加载，不要再次加载')
    }
  }
}
